<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var str1 = "qqw";
        console.log(str1.substr(1,2));//从索引1开始，截取2个字符,输出qw
        console.log(str1.slice(1,2));//截取索引1到索引2之间的字符,输出q
    </script>
</head>
<body>

</body>
</html>